package com.hqyj.seataorder.service.impl;

import com.hqyj.seataorder.domain.OrderForm;
import com.hqyj.seataorder.mapper.OrderFormMapper;
import com.hqyj.seataorder.service.OrderService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderFormMapper orderFormMapper;
    @Override
    public void create(int userId, int productId, int number, int money) {
        // 生成订单
        OrderForm order = new OrderForm();
        order.setUserId(userId);
        order.setProductId(productId);
        order.setNumber(number);
        order.setMoney(money);
        System.out.println(order.toString());
        orderFormMapper.insert(order);
    }
}
